import Vue from 'vue'
import Router from 'vue-router'
import Home from '@/views/pc/home.vue'
import Login from '@/views/pc/login.vue'
// 个人中心
import MessageManage from '@/views/pc/person/message-manage.vue'
import UserInfo from '@/views/pc/person/user-info.vue'
// 管理面板
import UserManage from '@/views/pc/admin/user-manage.vue'
// 订单页面
import OrderManage from '@/views/pc/order/order-manage.vue'
import OrderDetail from '@/views/pc/order/order-detail.vue'
// 商品管理
import itemManage from '@/views/pc/seller/item-manage.vue'
import itemEdit from '@/views/pc/seller/item-edit.vue'
// 外贸商品管理
import tradeForeignManage from '@/views/pc/tradeforeign/trade-order-manage.vue'
import tradeForeignDetail from '@/views/pc/tradeforeign/trade-order-detail.vue'
import tradeOrder from '@/views/pc/trade/order.vue'

const router = new Router({
  mode: 'history',
  base: '/dist',
  routes: [
    {
      path: '/',
      name: '首页',
      component: Home,
      // redirect: '/index',
      children: [
        {
          path: '/person/message',
          name: '消息列表',
          component: MessageManage
        }, {
          path: '/person/info',
          name: '个人资料',
          component: UserInfo
        }, {
          path: '/admin/usermanage',
          name: '员工管理',
          component: UserManage
        }, {
          path: '/order/ordermanage',
          name: '订单管理',
          component: OrderManage
        }, {
          path: '/order/orderdetail/:orderId',
          name: '订单详情',
          component: OrderDetail
        }, {
          path: '/seller/itemmanage',
          name: '商品管理',
          component: itemManage
        }, {
          path: '/seller/itemedit/:type/:itemId',
          name: '商品详情',
          component: itemEdit
        }, {
          path: '/tradeforeign/itemmanage',
          name: '外贸商品管理',
          component: tradeForeignManage
        }, {
          path: '/tradeforeign/itemdetail/:type/:orderId',
          name: '外贸商品详情',
          component: tradeForeignDetail
        }, {
          path: '/trade/order',
          name: '外贸订单',
          component: tradeOrder
        },
      ]
    },
    {
      path: '/login',
      name: '登陆',
      component: Login
    }
  ]
})

Vue.use(Router)

export default router


